<template>
  <div class="login-bg">
    <canvas id="cas"></canvas>
    <el-form class="login-wrapper">
      <el-form-item>
        <h2 class="login-title">管理员登录</h2>
      </el-form-item>
      <el-form-item>
        <el-input placeholder="请输入账号" prefix-icon="iconfont icon-username"/>
      </el-form-item>
      <el-form-item>
        <el-input placeholder="请输入密码" prefix-icon="iconfont icon-passwrod" type="password"/>
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          class="login-btn"
          @click="submitBtn"
        >登&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'Login',
  methods: {
    initCanvas () {
      // const canvas = document.getElementById('cas')
      // const ctx = canvas.getContext('2d')
    },
    submitBtn () {
      this.$router.push({ path: '/class/style' })
    }
  }
}
</script>

<style lang="scss" scoped>
.login-bg {
  position: fixed;
  width: 100%;
  height: 100%;
  background: url("../../assets/images/login-bg.jpg") center fixed;
  background-size: cover;
  .login-wrapper {
    width: 300px;
    padding: 40px;
    margin: 200px auto;
    background: #fff;
    box-shadow: 0 0 2px #fff;
    .login-title {
      font-size: 20px;
      font-weight: 700;
      text-align: center;
      letter-spacing: 2px;
    }
    .login-btn {
      width: 100%;
      font-size: 16px;
    }
  }
}
</style>
